﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


class ArrayFromAToZ
{
    static int BinSearch(int left, int right, char element, char[] arr)
    {

        int middle = (right + left) / 2;

        if (arr[middle] > element)
        {
            return BinSearch(left, middle, element, arr);
        }
        else if (arr[middle] < element)
        {
            return BinSearch(middle, right, element, arr);
        }

        else
        {
            return middle;
        }

    }

    static void Main()
    {
        char[] arr = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
                     'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
                string word = Console.ReadLine();
        for (int i = 0; i < word.Length; i++)
        {
            Console.WriteLine(BinSearch(0, 25, word[i], arr)); 
        }
    }
}

